import request from '../utils/request'

export const getcontantList = params => {
  return request({
    method: 'GET',
    url: '/directorys',
    params
  })
}
export const putcontantList = (id, state) => {
  return request({
    method: 'POST',
    url: `/directorys/${id}/${state === 1 ? 0 : 1}`
  })
}
export const studyList = () => {
  return request({
    method: 'GET',
    url: '/subjects/simple'
  })
}
export const addstudyList = data => {
  return request({
    method: 'POST',
    url: '/directorys',
    data
  })
}
export const alterstudyList = (id, data) => {
  return request({
    method: 'PUT',
    url: `/directorys/${id}`,
    data
  })
}
export const delcontantList = (id) => {
  return request({
    method: 'DELETE',
    url: `/directorys/${id}`,
    id
  })
}
